﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO.Ports;
using System.Text.RegularExpressions;
using System.Threading;
using System.Reflection; // 引用这个才能使用Missing字段
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Web;
using System.Runtime.InteropServices;
using CCWin;
namespace weiqijiance
{
    public partial class shebeizijian : CCSkinMain
    {

        // /声明INI文件的写操作函数 WritePrivateProfileString()
        [DllImport("kernel32")]
        private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);

        //声明INI文件的读操作函数 GetPrivateProfileString()
        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
        private string sPath = null;

        public static string registCode;

        public mainform m_mainform;

        public shebeizijian()
        {
            InitializeComponent();
            registCode = "";
            //xinxichushihua();
        }
        //ini文件
        public void Ini(string path)
        {
            this.sPath = path;
        }
        public void Writue(string section, string key, string value)
        {
            // section=配置节，key=键名，value=键值，path=路径
            WritePrivateProfileString(section, key, value, sPath);
        }
        public string ReadValue(string section, string key)
        {
            // 每次从ini中读取多少字节
            System.Text.StringBuilder temp = new System.Text.StringBuilder(255);

            // section=配置节，key=键名，temp=上面，path=路径
            GetPrivateProfileString(section, key, "", temp, 255, sPath);
            return temp.ToString();
        }


        public void xinxichushihua()
        {
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\授权码.ini";
            string path1 = string.Format(@"{0}", path);
            Ini(path1);


            registCode = ReadValue("授权码", "授权码1");
           
           
        }
       
      
       

        private void skinBut_speed_Click(object sender, EventArgs e)
        {
            JDspeed obj = new JDspeed();
            obj.m_mainform = m_mainform;
          //  this.Close();
            obj.ShowDialog();
        }

        private void skinBut_GL_Click(object sender, EventArgs e)
        {
            JDGuangliang obj = new JDGuangliang();
            obj.m_mainform = m_mainform;
           //this.Close();
            obj.ShowDialog();
        }

        private void skinBut_hzh_Click(object sender, EventArgs e)
        {
            //JDHengJiaZai obj = new JDHengJiaZai();
            国标自检类.GBJZHX obj = new 国标自检类.GBJZHX();
            obj.m_mainform = m_mainform;
           // this.Close();
            obj.ShowDialog();
        }

        private void skinBut_bzh_Click(object sender, EventArgs e)
        {
            //JDBianJiaZai obj = new JDBianJiaZai();
            //obj.m_mainform = m_mainform;
            ////this.Close();
            //obj.ShowDialog();
            国标自检类.GBBJZ f = new 国标自检类.GBBJZ();
            f.m_mainform = m_mainform;
            f.ShowDialog();
        }

        private void skinBut_neizu_Click(object sender, EventArgs e)
        {
            JDNeiZu obj = new JDNeiZu();
            obj.m_mainform = m_mainform;
         //   this.Close();
            obj.ShowDialog();
        }

        private void skinBut_wendu_Click(object sender, EventArgs e)
        {
            wendu obj = new wendu();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinBut_yure_Click(object sender, EventArgs e)
        {
            yure obj = new yure();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton2_Click(object sender, EventArgs e)
        {
            yiqijianding obj = new yiqijianding();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton1_Click(object sender, EventArgs e)
        {
            检测方法自检 obj = new 检测方法自检();
            obj.m_mainform = this.m_mainform;
            obj.ShowDialog();
        }

        private void skinButton3_Click(object sender, EventArgs e)
        {
            btgyiqijianding obj = new btgyiqijianding();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton5_Click(object sender, EventArgs e)
        {

            MessageBox.Show(m_mainform.objbass.JCZT("1"));
        }

        private void skinButton4_Click(object sender, EventArgs e)
        {

            MessageBox.Show(m_mainform.objbass.JCZT("2"));
        }

        private void skinButton6_Click(object sender, EventArgs e)
        {

            JDHuaXing obj = new JDHuaXing();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton7_Click(object sender, EventArgs e)
        {
            //guochengshuju obj = new guochengshuju();
            jdsjcx obj = new jdsjcx();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton6_Click_1(object sender, EventArgs e)
        {
            JDHuaXing obj = new JDHuaXing();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton8_Click(object sender, EventArgs e)
        {
            设备自检及检定.qitisetting obj = new 设备自检及检定.qitisetting();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinButton9_Click(object sender, EventArgs e)
        {
            自检.JDZS f = new 自检.JDZS();
            f.m_mainform = m_mainform;
            f.ShowDialog();
        }
    }
}
